/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Cyrax
 */
@Entity
@Table(name = "TicketsSummary", catalog = "EasyTickets", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TicketsSummary.findAll", query = "SELECT t FROM TicketsSummary t"),
    @NamedQuery(name = "TicketsSummary.findByTicketsSummaryId", query = "SELECT t FROM TicketsSummary t WHERE t.ticketsSummaryId = :ticketsSummaryId"),
    @NamedQuery(name = "TicketsSummary.findByTotalQuantity", query = "SELECT t FROM TicketsSummary t WHERE t.totalQuantity = :totalQuantity"),
    @NamedQuery(name = "TicketsSummary.findByTotalCost", query = "SELECT t FROM TicketsSummary t WHERE t.totalCost = :totalCost")})
public class TicketsSummary implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TicketsSummaryId", nullable = false)
    private Integer ticketsSummaryId;
    @Column(name = "TotalQuantity")
    private Integer totalQuantity;
    @Column(name = "TotalCost", precision = 15)
    private Double totalCost;
    @JoinColumn(name = "TicketsId", referencedColumnName = "TicketsId")
    @ManyToOne
    private Tickets tickets;
    @JoinColumn(name = "Email", referencedColumnName = "Email")
    @ManyToOne
    private Customer customer;

    public TicketsSummary() {
    }

    public TicketsSummary(Integer ticketsSummaryId) {
        this.ticketsSummaryId = ticketsSummaryId;
    }

    public Integer getTicketsSummaryId() {
        return ticketsSummaryId;
    }

    public void setTicketsSummaryId(Integer ticketsSummaryId) {
        this.ticketsSummaryId = ticketsSummaryId;
    }

    public Integer getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(Integer totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public Double getTotalCost() {
        return totalCost;
    }

    public void setTotalCost(Double totalCost) {
        this.totalCost = totalCost;
    }

    public Tickets getTickets() {
        return tickets;
    }

    public void setTickets(Tickets tickets) {
        this.tickets = tickets;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ticketsSummaryId != null ? ticketsSummaryId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TicketsSummary)) {
            return false;
        }
        TicketsSummary other = (TicketsSummary) object;
        if ((this.ticketsSummaryId == null && other.ticketsSummaryId != null) || (this.ticketsSummaryId != null && !this.ticketsSummaryId.equals(other.ticketsSummaryId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TicketsSummary[ticketsSummaryId=" + ticketsSummaryId + "]";
    }
}
